﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Elements.Links
{
    /// <summary>
    /// 贝塞尔连线定义
    /// </summary>
    public class BezierLink : LinkBase
    {
        public override void Draw(Graphics g)
        {
            var startPoint = StartShape.GetCentertPoint();
            var endPoint = EndShape.GetCentertPoint();

            var ctlPoint1 = new Point(startPoint.X + 50, startPoint.Y);
            var ctlPoint2 = new Point(endPoint.X - 50, endPoint.Y);

            g.DrawBezier(new Pen(BackgroundColor, 2),
               startPoint,
               ctlPoint1,
               ctlPoint2,
               endPoint);
        }
    }
}
